<?php

    header("Access-Control-Allow-Origin:*");
    $con = mysqli_connect('localhost','root','hl0319');

    mysqli_select_db($con,'shuffling');

    mysqli_query($con,"set charset 'utf8'");
    mysqli_query($con,"set character set 'utf8'");

    $sql = "select * from imgs";

    $res = mysqli_query($con,$sql);

    $list = array();

    while($row = mysqli_fetch_assoc($res)){
        array_push($list,$row);
    };
    
    echo json_encode(array(
        "code" => 200,
        "body" => array(
            "list" => $list
        )
    ));

?>